<?php
require_once 'db.php';


class san_pham extends DB{
    
    private $_table='san_pham';
    public function __construct() {
        parent::getConnection();
    }
    
     public function insert($work) {
         error_reporting(0);
            $query = 'INSERT INTO ' . $this->_table . ' (
                                        name,
                                        gia,
                                        gioi_tinh,
                                        chuan_loai,
                                        id_khuyen_mai,
                                        nhap_vao,
                                        da_ban,
                                        mo_ta,
                                        hinh_anh,
                                        status
                                        )' .
                    ' VALUES (' .
                    '"' . mysql_escape_string($work['name']) . '",' .
                          mysql_escape_string($work['gia']).','.
                          mysql_escape_string($work['gioi_tinh']).','.
                          mysql_escape_string($work['chuan_loai']).','.
                          mysql_escape_string($work['id_khuyen_mai']).','.
                          mysql_escape_string($work['nhap_vao']).','.
                          '0,'.
                    '"' . mysql_escape_string($work['mo_ta']) . '",' .
                    '"' . mysql_escape_string($work['hinh_anh']) . '",' .
                    '0'.
                    ')';
            echo $query;
            
            var_dump($this->query($query));
            
    }
    
}
